Boot Process¶
Bios -> POST -> Sector 0 of bootable device -> Boot loader -> Kernel & Initrd (initramfs) -> Kernel -> Init
- Bios
- Basic input output
- Is a frimware stored on R/O chip
- First program that runs when sys powers on
- Performs POST
- Locate and runs boot loader
- Provides an interface to configure hardware
- Active onboard HW
- Boot order, etc.
- non-volatile
- CMOS
- Is a special memory chip
- Hold basic informations (256 Byte)
- Current date and time
- HW configuration needed by BIOS
- volatile (Battery)
- Complementary metal oxide semiconductor
- Post
- Power on self-test
- Does moderboard works?
- Is GPU installed?
- Is memory working correctly?
- MBR
- Master Boot Record (512 Byte)
- The first sector of the computer hard drive [sector 0]
- Magic Code [2 Byte] (0xAA55) (0b1010101001010101)
- BIOS will try booting the system
- Garbled or 0x0000 [error/tries booting the next disk]
- How the hard drive is partitioned [Partition table] (64 Byte)
- How to load the operating system [Boot Code / Bootloader] (446 Byte)
MBR layout¶
Bootloaders [N05]¶
- Lilo
- Does not understand or parse filesystem
- /etc/lilo.conf
- information about location of kernel and ram disks, the configuration file is written with bootloader code into MBR
- Grub legacy
- Logic to read common file systems
- 3 Stages
- Grub2
- automatically generated
- chain-loading
- full scripting language: variables, conditionals, and loops are available
- available for several other types of system
- can read files directly from LVM and RAID
- Changes from legacy
- Syslinux
- Specializes in booting full Linux installations from FAT filesystems
- Live USBs
- Linux live CDs and bootable install CDs
Initrd or Initramfs [N01.1]¶
Init¶
- Process N1
- Runlevels
- Daemons (services)
- Desktop login manager (if any)
- All other programs
- init systems
- BSD-Style
- SysV
- Upstart
- openrc
- systemd
- shepherd
How knows where these stuff are? [N20]